import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class FaceReplace {

	public static void main(String[] args) {
		regx01();
	}

	private static void regx01() {
		String oBody = "【洋葱头左右摇摆】jajsd【猪猪不理】fjla【色】dfafafad【闭嘴】fdfa【闭嘴】gdsgdf【】gsd";
		Pattern p = Pattern.compile("��[^����]+��");
		Matcher m = p.matcher(oBody);
		StringBuffer sbr = new StringBuffer();
		while (m.find()) {
			System.out.println(m.group(0));
			String faceUrl = "[img=" + ForumFaceDAO.covUrl(m.group(0)) + "][/img]";
			m.appendReplacement(sbr, faceUrl);
		}
		m.appendTail(sbr);
		System.out.println(sbr.toString());
	}

}
